using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Shpm.System;
using Shpm.App.Commons.Utils;

public partial class Design_MasterPage : System.Web.UI.MasterPage
{
    protected string mainMenuName = string.Empty;
    protected string mainMenuUrl = string.Empty;
    protected string infoMessage = string.Empty;

    public string InfoMessage
    {
        get
        {
            return infoMessage;
            // return labInfoMessage.Text;
        }

        set
        {
            // labInfoMessage.Text = value;
            infoMessage = value;
        }
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        // Register Ajax Common Class
        Ajax.Utility.RegisterTypeForAjax(typeof(CommonAjaxUtils),this.Page);

        MainMenuManager mamager = new MainMenuManager(Context);
        if (mamager != null)
        {
            MainMenuBean menuBean = mamager.GetCurrentMenu();

            if (menuBean != null)
            {
                this.mainMenuName = menuBean.MainMenuName;
                this.mainMenuUrl = this.ResolveUrl(menuBean.MainMenuUrl);
            }
        }
        
        /*
        Control cnt = this.ContentPlaceHolder1.FindControl("PanelNavigate");

        if (cnt != null && cnt is Panel)
        {
            Panel PanelNavigate = (Panel)cnt;
            PanelNavigate.HorizontalAlign = HorizontalAlign.Right;

            MainMenuManager mamager = new MainMenuManager(Context);

            if (mamager != null)
            {
                MainMenuBean menuBean = mamager.GetCurrentMenu();
                if (menuBean != null)
                {
                    LinkButton lnkMainMenuButton = new LinkButton();
                    lnkMainMenuButton.Text = menuBean.MainMenuName;
                    lnkMainMenuButton.PostBackUrl = menuBean.MainMenuUrl;

                    PanelNavigate.Controls.Add(lnkMainMenuButton);

                    if ( string.IsNullOrEmpty(this.Page.Title)==false )
                    {
                        LiteralControl lc = new LiteralControl(" >> " + this.Page.Title);
                        PanelNavigate.Controls.Add(lc);
                    }
                }
            }
        }
        */
    }
}
